home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
0022-3.564
/
dmg-3418
/
gfa_prog.s
/
unpaklow.lst
< prev
next >
Wrap
File List
|
1986-02-05
|
4KB
|
75 lines
' ****************************************
' * Listing from DBA Diskmagazine 3 *
' * *
' * Low-res Degas picture loader *
' * and un-packer in GFA *
' * Converted from Hi-soft basic -> GFA *
' * Program by Bonus Software *
' * *
' ****************************************
'
'
sc%=XBIOS(3) ! start address screen
'
DO
SHOWM ! showm mouse
FILESELECT "a:\pictures\*.pc1","default.pc1",a$ ! fileselector to choose pic.
IF a$<>"" ! if exists
HIDEM ! hide mouse
OPEN "i",#1,a$ ! open picture
dummy$=INPUT$(2,#1) ! read first 2 usless (to us)
' ! bytes.
FOR i%=0 TO 15 ! for next to get the 16 colors
c%=256*ASC(INPUT$(1,#1))+ASC(INPUT$(1,#1))! make decimal value of it
SETCOLOR i%,c% ! setcolor to the value
NEXT i% ! get next color
scr%=sc% ! copy screen address in scr%
FOR scan%=0 TO 199 ! for next for number of lines
FOR plane%=0 TO 6 STEP 2 ! for next for number of bit
~INP(2)
' ! planes ( low res 4 planes )
addr%=scr%+160*scan%+plane% ! screen counter
volg%=addr%+160 ! screen counter + 1 line
DO ! start unpacking
b%=ASC(INPUT$(1,#1)) ! get byte
IF b%<128 ! if it is smaller then 128
FOR i%=0 TO b% !
POKE addr%,ASC(INPUT$(1,#1)) ! poke it straight into the
' ! screen
IF addr% AND 1
addr%=addr%+7
ELSE
INC addr%
ENDIF
NEXT i%
ENDIF
IF b%>128 ! if bigger then 128
tel%=ASC(INPUT$(1,#1)) ! get next byte for signed
' ! single byte number
FOR i%=1 TO 256-b%+1 ! subtract it from 256 to know
' ! the signed one.
POKE addr%,tel% ! poke into screen
IF addr% AND 1
addr%=addr%+7
ELSE
INC addr%
ENDIF
NEXT i%
ENDIF
EXIT IF addr%=volg% !exit if end of line
LOOP
NEXT plane% ! next plane in line
NEXT scan% ! next line
CLOSE #1 ! if end of file close #1
OUT 2,7 ! make ping sound to know if
' ! picture is ready
~INP(2) ! wait for key press
CLS ! clear screen
SETCOLOR 0,0 ! black background
SETCOLOR 15,7,7,7 ! white letters
ELSE
END ! if no filename is chosen
' ! then just end program
ENDIF
LOOP